package common.library.utils;

import android.util.Log;

import java.util.logging.Logger;

/**
 * 在logcat里面看
 */
public class LogUtil {

    private final static String tag = "★★★";

    public static Logger logger = Logger.getLogger(tag);

    public static void info(Object value, Object... args) {
        Log.w(tag, StringUtil.format(value, args));
    }

    public static void warning(Object msg) {
        logger.warning(msg.toString());
    }

    public static void error(Object msg) {
        Log.e(tag, msg.toString());
    }

    public static void error(Exception ex) {
        Log.e(tag, ex.getMessage() + "\r\n" + ex.getStackTrace()[0]);
    }

    public static void debug(Object value, Object... args) {
        Log.d(tag, StringUtil.format(value, args));
    }

    public static void log(Object value, Object... args) {
        debug(value, args);
    }

}
